package com.bw.liuyushan.mvp_lib.VIew;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.bw.liuyushan.mvp_lib.Presenter.IPresenter;

/**
 * Liuyushan20210904
 * file name is : BaseFragment
 * created by Ender on 2021/9/4 8:15.
 * author : 刘雨杉
 * Describe:
 */
public abstract class BaseFragment<P extends IPresenter> extends Fragment implements IFragment,IView {
    protected P mPresenter;
    View view;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return view=inflater.inflate(bindLayout(), container, false);
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        initView();
        initDate();
    }

    @Override
    public <T extends View> T findViewById(int id) {
        return view.findViewById(id);
    }
}
